﻿namespace ConfigDatabase.Forms
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class frmSuaThongSo_pass : Form
    {
        private bool _bThanhCong = false;
        private Button btnxacnhan;
        private Button butKetthuc;
        private IContainer components = null;
        private Label lblthongbao;
        private Label lblwebsite;
        private TextBox txtmatkhau;
        string _spassword = "caovu" + DateTime.Now.ToString("ddMMyyyy");
        /// <summary>
        /// Trả về hoặc thiết lập mật khẩu xác nhận.
        /// </summary>
        public string pMatKhau
        {
            get { return _spassword; }
            set { _spassword = value; }
        }
        public frmSuaThongSo_pass()
        {
            this.InitializeComponent();
        }

        private void btnxacnhan_Click(object sender, EventArgs e)
        {
            this._bThanhCong = false;
            //string str = "caovu" + DateTime.Now.ToString("ddMMyyyy");
            if (this.txtmatkhau.Text == _spassword)
            {
                this._bThanhCong = true;
                base.Close();
            }
            else
            {
                this.lblthongbao.Visible = true;
                this.txtmatkhau.Focus();
            }
        }

        private void butKetthuc_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void frmSuaThongSo_pass_Load(object sender, EventArgs e)
        {
            this.lblthongbao.Visible = false;
        }

        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmSuaThongSo_pass));
            this.txtmatkhau = new System.Windows.Forms.TextBox();
            this.lblwebsite = new System.Windows.Forms.Label();
            this.btnxacnhan = new System.Windows.Forms.Button();
            this.butKetthuc = new System.Windows.Forms.Button();
            this.lblthongbao = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // txtmatkhau
            // 
            this.txtmatkhau.Location = new System.Drawing.Point(77, 26);
            this.txtmatkhau.Name = "txtmatkhau";
            this.txtmatkhau.PasswordChar = '@';
            this.txtmatkhau.Size = new System.Drawing.Size(241, 20);
            this.txtmatkhau.TabIndex = 39;
            this.txtmatkhau.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtmatkhau_KeyDown);
            // 
            // lblwebsite
            // 
            this.lblwebsite.AutoSize = true;
            this.lblwebsite.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblwebsite.Location = new System.Drawing.Point(10, 27);
            this.lblwebsite.Name = "lblwebsite";
            this.lblwebsite.Size = new System.Drawing.Size(65, 16);
            this.lblwebsite.TabIndex = 40;
            this.lblwebsite.Text = "Mật khẩu:";
            // 
            // btnxacnhan
            // 
            this.btnxacnhan.Image = ((System.Drawing.Image)(resources.GetObject("btnxacnhan.Image")));
            this.btnxacnhan.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnxacnhan.Location = new System.Drawing.Point(91, 58);
            this.btnxacnhan.Name = "btnxacnhan";
            this.btnxacnhan.Size = new System.Drawing.Size(89, 25);
            this.btnxacnhan.TabIndex = 41;
            this.btnxacnhan.Text = "      Xác nhận";
            this.btnxacnhan.UseVisualStyleBackColor = true;
            this.btnxacnhan.Click += new System.EventHandler(this.btnxacnhan_Click);
            // 
            // butKetthuc
            // 
            this.butKetthuc.BackColor = System.Drawing.Color.Transparent;
            this.butKetthuc.Image = ((System.Drawing.Image)(resources.GetObject("butKetthuc.Image")));
            this.butKetthuc.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butKetthuc.Location = new System.Drawing.Point(186, 58);
            this.butKetthuc.Name = "butKetthuc";
            this.butKetthuc.Size = new System.Drawing.Size(88, 25);
            this.butKetthuc.TabIndex = 104;
            this.butKetthuc.Text = "Kết thúc";
            this.butKetthuc.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.butKetthuc.UseVisualStyleBackColor = false;
            this.butKetthuc.Click += new System.EventHandler(this.butKetthuc_Click);
            // 
            // lblthongbao
            // 
            this.lblthongbao.AutoSize = true;
            this.lblthongbao.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblthongbao.ForeColor = System.Drawing.Color.Red;
            this.lblthongbao.Location = new System.Drawing.Point(88, 5);
            this.lblthongbao.Name = "lblthongbao";
            this.lblthongbao.Size = new System.Drawing.Size(196, 16);
            this.lblthongbao.TabIndex = 40;
            this.lblthongbao.Text = "Xác nhận mật khẩu không đúng.";
            // 
            // frmSuaThongSo_pass
            // 
            this.BackColor = System.Drawing.Color.PaleTurquoise;
            this.ClientSize = new System.Drawing.Size(329, 91);
            this.ControlBox = false;
            this.Controls.Add(this.butKetthuc);
            this.Controls.Add(this.btnxacnhan);
            this.Controls.Add(this.txtmatkhau);
            this.Controls.Add(this.lblthongbao);
            this.Controls.Add(this.lblwebsite);
            this.MaximumSize = new System.Drawing.Size(345, 130);
            this.MinimumSize = new System.Drawing.Size(345, 130);
            this.Name = "frmSuaThongSo_pass";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Xác nhận mật khẩu";
            this.Load += new System.EventHandler(this.frmSuaThongSo_pass_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        private void txtmatkhau_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                SendKeys.Send("{Tab}");
            }
        }

        public bool ThanhCong
        {
            get
            {
                return this._bThanhCong;
            }
        }

       
    }
}

